package org.wevil.repo;

import org.wevil.entity.cond.CondRoleOrg;
import org.wevil.entity.pk.PKCondRoleOrg;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface CondRoleOrgRepo extends BaseRepo<CondRoleOrg, PKCondRoleOrg>{

    @Query(value = "select org_id from cond_role_org where role_id = ?1", nativeQuery = true)
    Integer findOrgIdByRoleId(int userId);

    @Modifying
    void deleteByRoleId(int userId);

    @Modifying
    void deleteByOrgId(int userId);
}
